function releaseComment(id){
    var disabled=$("#data").val() ? false : true
    if(disabled==true) {
        alert("请先登录！")
    }
    else {
        var content=$("#comment_content"+id).val()
        $.ajax({
            url: "/addComment",
            type: "POST",
            data: {
                "id":id,
                "content":content
            },
            success: function (result) {
                console.log(result);
                if (result=="success"){
                    var type = $("#type").val()
                    window.location.href="/index?type=" + type
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert("错误！");
            }
        })
    }
}
function like(id){
    var disabled=$("#data").val() ? false : true
    if(disabled==true){
        alert("请先登录！")
    }else{
        $.ajax({
            url: "/like",
            type: "POST",
            data: {
                "xianyuId":id
            },
            success: function (result) {
                console.log(result);
                if (result=="success"){
                    var type = $("#type").val()
                    window.location.href="/index?type=" + type
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert("错误！");
            }
        })
    }

}
